#include <iostream>
#include <vector>
#include <algorithm>

class GameAccount {
private:
    std::string playerID;
    std::string account;
    std::vector<int> gameInventory;

public:
    // 构造函数
    GameAccount(const std::string& id, const std::string& acc) : playerID(id), account(acc) {}

    // 打印玩家ID，账号和游戏库存数量
    void printDetails() {
        std::cout << "Player ID: " << playerID << "\n";
        std::cout << "Account: " << account << "\n";
        std::cout << "Number of games in inventory: " << gameInventory.size() << "\n";
    }

    // 存入库存中参数指定编码的游戏
    void addGame(int gameCode) {
        gameInventory.push_back(gameCode);
    }

    // 删除库存中参数指定编码的游戏
    void removeGame(int gameCode) {
        gameInventory.erase(std::remove(gameInventory.begin(), gameInventory.end(), gameCode), gameInventory.end());
    }
};


int main() {
    // 创建一个GameAccount对象
    GameAccount myAccount("Player1", "account1");

    // 打印详情
    myAccount.printDetails();

    // 添加游戏到库存
    myAccount.addGame(123);
    myAccount.addGame(456);

    // 打印详情
    myAccount.printDetails();

    // 从库存中删除游戏
    myAccount.removeGame(123);

    // 打印详情
    myAccount.printDetails();

    return 0;
}
